package com.derbysoft.nuke.configkeeper.domain;

import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBAttribute;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBHashKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBRangeKey;
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTable;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
@AllArgsConstructor
@DynamoDBTable(tableName = "CK_CONFIG_HISTORY")
public class ConfigHistory {

    public ConfigHistory() {
        // only for mapper
    }

    public final static String ACTION_ADD = "ADD";
    public final static String ACTION_UPDATE = "UPDATE";
    public final static String ACTION_DELETE = "DELETE";

    @DynamoDBHashKey(attributeName = "source")
    private String source;
    @DynamoDBRangeKey(attributeName = "timestamp")
    private Long timestamp;
    @DynamoDBAttribute(attributeName = "key")
    private String key;
    @DynamoDBAttribute(attributeName = "value")
    private String value;
    @DynamoDBAttribute(attributeName = "action")
    private String action;
}
